/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package assignment_cp3120.ucm;

import assignment_cp3120.manager.createairport.CreateAirportModel;
import assignment_cp3120.manager.createairport.CreateAirportView;

/**
 * PRECONDITION: view has been shown
 *
 * 1. user fills in form
 * 2. System edits the selected airport with the given info.
 * @author Administrator
 *
 * POSTCONDITION: airport has been created and added to the db
 */
public class UCCreateAirports implements UseCaseController{
    private CreateAirportView view;
    private CreateAirportModel model;

    public UCCreateAirports() {
        this(new CreateAirportView(), new CreateAirportModel());
    }
    public UCCreateAirports(CreateAirportView view, CreateAirportModel model) {
        this.view = view;
        this.model = model;
    }

    public void run() {
        //* 3. System edits the selected airport with the given info.
        model.createAirport(view.getId(), view.getAirportName(), view.getAirportTax());

        view.clearView();
    }
}